package com.guguskins.back.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * <p>
 * 
 * </p>
 *
 * @author mybatis-plus
 * @since 2021-06-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("gu_hen_house_task")
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class GuHenHouseTask extends Model<GuHenHouseTask> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "task_id", type = IdType.AUTO)
    private Long taskId;

    /**
     * 0 无效 1 正在孵化 2 已完成
     */
    private Integer taskState;

    /**
     * 用户id
     */
    private Long taskUserId;

    /**
     * steamId
     */
    private String taskSteamId;

    /**
     * 鸡舍id
     */
    private Long taskHenHome;

    /**
     * 库存id
     */
    private Long taskInventoryId;

    /**
     * 材料id
     */
    private Long taskGoodsId;

    /**
     * 1 金蛋 2 银蛋
     */
    private Integer taskEggType;

    /**
     * 限制使用道具卡数量
     */
    private Integer taskLimitCard;

    /**
     * 结束时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime taskExpirationTime;

    /**
     * 奖品
     */
    @JsonIgnore
    private Long taskPrizeId;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime taskCreateTime;

    /**
     * 更新时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime taskUpdateTime;


    @Override
    protected Serializable pkVal() {
        return this.taskId;
    }

}
